1,891 Topics
| |
I've got an array CALENDER=(31 28 31 30 31 30 31 31 30 31 30 31) I have two if statements that Need to get an index from the array above but when I feed a value into the brackets e.g. ${CALENDER[${SECONDDIGIT}]} or ${CALENDER[${FIRSTDIGIT}]} it seems to only be getting … | |
I wrote the following script to try and get validate if a date was valid or not. I think I've about got the script done but I'M having some trouble getting the values from the array. When I input 11291985 into the program I'M getting "29 is invalid" I can't … | |
| Hi, I watched some shell scripting codes and I saw that there is a command, which name is LISTEN. What is the logic of this command and how I can use it? |
I'M trying to test a function that would be able to determine if it was or was not leap year. I believe my problem lies in the if statement but due to my lack of knowledge concerning shell I don't know what else to do here. #! /bin/bash read -p … | |
How do you start a SSH server on localhost through executing a shell script? If so, is there any way to restrict the commands performed or use another shell script as it's default console (i.e. Instead of Terminal.app it uses X11)? | |
Below is a program I'M trying to write that will take an 8 digit date and validate whether or not it's a valid date. I'M very new to shell scripting so I really a have no idea what I'M going. Could you take a look and let me know what … | |
Hi,I am using following code for FTP in shell script file and it is working.Now I want to migrate from FTP to SFTP.What code changes/steps I have to perform for SFTP ? ftp -in <<FIN open $SAP_UP_SERVER user $SAP_UP_USER $SAP_UP_PASSWORD asc put $PM00_OUTPUTS_DIRECTORY/$SAP_UP_FILE_CSV /$SAP_UP_FILE_CSV put $PM00_OUTPUTS_DIRECTORY/$SAP_UP_FILE_CTL /$SAP_UP_FILE_CTL prompt ... End … | |
I'M trying to write a small program that will validate weather or not a string is valid. Assuming that the date will always be 8 digits (12/21/2012) I need a function that will count the number of digits in a string. What I've got below is only returning "'is not … | |
| I saw that github commands in linux terminal always uses word "git" before all it's commands. How to use my own word for my shell script? for example, $ git commit or $ git status |
I have a text file for ex: ABCD#sh run aaaaaaaaa bbbbbbbbb ccccccccc ABCD#sh int dddddddd eeeeeeee ABCD#sh xvy and so on.... I want to parse the lines between ABCD# and the next ABCD#. And send this parse output to CSV file or excel like aaaaaaaa dddddddd bbbbbbbb eeeeeeee cccccccc Please … | |
OK so I am basically brand new to shell scripts and new to Unix in general. I have a server that has two profiles, one is a shared account for a few friends and I and the other is one that I use to run video game servers off of. … | |
How to pass password using scp in commandline SCP <filename> <user>@<Toserveraddress>:<path> Here i want to use password also , how can i use ???? | |
needed help how can i connect to my oracle database using shell script and how can i assign particular value in table to a variable defined in shellscript and i use sqlplus but i get error | |
hi i want to display only elements of array tht start with a number can i do that using egrep" | |
I have a bash script (test.sh) which reads parameters from the command line. The parameters could look like this: param1 param2 param3&ext param4 param5 The problem is that when the script reads the parameters and then echo them I get the following: param1 param2 param3 No command 'ext' found did … | |
Hi every one, I have a question. I have many files with this format: a...a-Cb...b-d...d a...a-b...b-Cd...d a...a-b...b-Cd...d-e...e so that : 1- a...a is a number with **m** digits, 2- b...b is a number with **n** digits, 3- d...d is a number with **p** digits, 4- e...e is a number with … | |
So Im using our university servers through an ssh connection. I have a bunch of files in a directory which I would like to run through a perl script. So I thought this simple script I concocted should do the trick. I have used similar script on my home computer … | |
Hi. I want to create my date format but i dont know how. I want the user to input the date in format DD-MON-YY or else it will give him an error. How can I do that? any algorithm? ANy help would be appreciated. Thanks! | |
echo "show run" the above commands gives input to terminal of router and then displays output on terminal. i want the output of this specific command to be redirected to the file. please help me | |
Hi All, I am sed and awk illiterate and needed some assistance. I would like to write a script that will have sed replace all spaces with \space. For example. Program Files would be... Program\ Files I can figure out how to replace the space with a backslash, however, when … | |
Hi, I am creating my project and I really need some help from you guys. I am creating a form, which will be save in a file. MY question is, is it possible to view the first question then the user should answer it first before the next question popped … | |
I have a flat file (template) where I want to replace variables based upon value in another file (csv). Variables in them template are named %VAR_Xz% The values are in the csv file and X is field 0 of each line and y field 1 and up. Example: Badidas, 13.00, … | |
hi guys i want to create that read from a text file to print the content of the file but i has the following error /te.txt: No such file or directory you should know that i install ubunto on vmware and the te.txt file i put it in the home … | |
I udnerstand that setting up a public/private key authentication is a way to go when automating scp copy files to target machines. however, I just now just to get a quick a dirty way to copy a number of files to a number of remote machines. My question is how … | |
Hi, I'm trying to write a "quick" powershell script to end processes passed as arguments: $args $check = Get-process $args foreach ($arg in $args) { if ($check -eq $null) { Write-host $arg " - Its not running" } else { Write-host $arg " - It's running" } } I'm trying … | |
Hi, I'm trying to get a bunch of files off an ftp server. I connect fine: batch script: ftp -v -s:"C:\Documents and Settings\xxxx\Desktop\download.txt" xx.xx.xx.xx and download.txt: xxxx xxxx lcd "D:\Data\FileDump" cd "backup" mget *.* It runs fine until it gets to the mget *.* and then it just outputs all … | |
I have a .sh script which is as follows. #/bin/bash ssh uname@111.XXX.111.XXX | mysqldump -u uname -p test_db>/home/dm/Downloads/test.sql # script ended I want to extract the script from the server "111.XXX.111.XXX" and keep it in a server directory but I do not want to log in to the server. So, … | |
hi, i am trying to parse a collection of text files that look like following. there a number of them but not all are structured exactly the same way.if i figure to parse this file i can handle the rest.i am novice in bash, and i want to parse the … | |
I have a shell script like as follows #!/bin/bash # Downloading Dumps from the production server. Date=`date +'%d-%m-%y-%H-%M'` BACKDIR=/home/tmp/Backup #IP Address of the Server Host="localhost" #User Name USER="root" #Database Name DBS="test_db" echo "Backing up MySQL databases..." echo "Time: `date`" mysqldump -h $HOST -v --user=$USER --password=$PASS $DBS test_tbl1 test_tble2 ...... > … | |
Below is a simple script to prompt for user input while suggesting an editable default value at the prompt: shortname=user1 read -e -i $shortname -p "Please enter the username you would like to add: " input USERNAME="${input:-$shortname}" Please enter the username you would like to add: user1 The above is … |
The End.