In shell scripting, a shell such as bash runs a file containing a list of commands (a script). The script is effectively a program and the shell is its interpreter.

learn more… | top users | synonyms

0
votes
1answer
17 views

how do i open a different host session from shell script and start a process on it

I want to open a new session and run a process on it as part of the shell script.How can that be acheived. I need open a session with test@Testhost and run a process ./testprocess on that separate ...
0
votes
1answer
22 views

exit shell script when a process check is failed

i need to exit from shell script when TESTEXCHANGE process is not running on a host.How can i handle this: I have a script processcheck which checks if the process is running. I call that to the ...
0
votes
2answers
42 views

execute shell script without entering password

I want to execute a script that requires root privileges without entering a password. There are similar questions/answers but non seems to work for me. I placed my script in /home/kf/bin (I added the ...
0
votes
1answer
34 views

Unable to hide unity launcher automatically on startup Ubuntu 14.04 machine and set reveal sensitivity to low of launcher form shell script

As per my project requirement, I need to hide unity launcher(if present) automatically on startup Ubuntu 14.04 machine. If I run the script dconf write ...
0
votes
0answers
11 views

Zenity and Yad messages/warnings in Lubuntu

How to clean those messages from the terminal? ** (yad:2499): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not ...
0
votes
4answers
51 views

Using grep in /etc/passwd to fetch list of users and system users, discriminating both

I want my grep to print a user list from /etc/passwd, and I've studied /etc/login.defs' minmax values for the ones I want my grep to fetch: # Min/max values for automatic uid selection in useradd # ...
1
vote
3answers
212 views

Shell script If syntax error

if ($(ipcs|grep test|wc -l)=630); then echo "Shared Memory check passed" fi I get below error: ./Test1: line 25: 636=630: command not found
0
votes
1answer
32 views

Replace /1/ with newline charecter [on hold]

I have a record like: "evSchema"\1\"UAT" "evSN"\1\"uadb" "evDirsep"\1\"/" "evRootPath"\1\"/work_area/APP_UAT/" "evSchema"\1\"RMS13" "evUser"\1\"STAGE" stored in a variable $record. I want to ...
0
votes
1answer
48 views

shell script executing on remote host

I want to run testcmd.sh on remote host (Testhost) using the following command: ssh test@Testhost 'bash -s' < /test/testcmd But I get the below error : !!!!!Running MASTERCMD!!!!! bash: line ...
0
votes
1answer
24 views

renaming files script error

I wrote code to change the name of bulk of file it should replace spaces with underscores and lowercase all the file name .. this is the code for file in *; do mv "$file" `echo $file | sed -e 's/ ...
0
votes
1answer
25 views

How can I show a variable in a dialog box

$value = V dialog --title "Message" --msgbox '(here the data stored in a variable value must be displayed' 10 20
0
votes
1answer
32 views

How to change file text content only with Shell Script commands?

In a file, there is: sd5_crypt UUID=1337 none luks,discard I'd like to change it to: sd5_crypt UUID=1337 /dev/disk/by-label/MON_LABEL_ICI:/keyfile luks,keyscript=/lib/cryptsetup/scripts/passdev ...
0
votes
1answer
35 views

How to write a shell script to start gedit and not showing the terminal window? [closed]

How to write a shell script to start gedit and not showing the terminal window? That means: when I click the file runme.sh, only gedit window shows, no terminal window shows. Just like I click the ...
0
votes
1answer
40 views

Running shell script using PHP over http

OS - Ubuntu 14.04 Well I am working on deployment using GIT webhooks for it. I havea added the deployment keys to git repo and now I want to trigger the git pull origin master command when a push ...
-3
votes
1answer
22 views

script to check if the file is sorted based on field 3

I want to check if the file is sorted.I have below file.I want to point out the records which are out of the order. 091000010004029881 1 08/03/2015 13:07:57.132 LS1508030031D8M00000 ...
4
votes
3answers
65 views

sort a file based on the field 3 of the file contents

This is the contents of file 090100010000481074 1 08/03/2015 09:35:15.934 LA150803000AJSX00000 LA150803000AJSX CRBP Buy ELF 100 1980000 119 3 2 1890000 ...
0
votes
0answers
32 views

QT gui application not starting automatically on startup in ubuntu 14.04

I have two Qt applications, one is non gui called "App1" and another one is gui called "App2". As per my need I need to start "App1" on startup of Ubuntu 14.04 machine. This "App1" runs a sh file ...
-1
votes
0answers
40 views

Analyse log file to display most visited websites [closed]

I have a web server log file to process and I'm required to write a shell script that analyses the log file to display the top 10 most visited websites in it. I'm extremely new to ubuntu server and ...
-4
votes
0answers
23 views

Shell script to read specific files in a folder and the change the filenames

I need a shell script that loops over all the files in a folder and does some actions on the files. For example. /data/LST/ABC folder has below: LSTFile1 LSTFile2 LSTFile3 LSTFile4 LSTFile5 ...
0
votes
2answers
33 views

shell script to check if a process is up

I want to check if a proces is up: [nyxqa@qckmaccg102 scripts]$ ps -fu nyxqa UID PID PPID C STIME TTY TIME CMD nyxqa 19620 1 0 08:42 ? 00:00:00 ./ArcaDirect ITD ...
3
votes
2answers
78 views

Difference between “./” and “. ” for running a script/application? [duplicate]

I always ran scripts using ./ For example ./script.sh I recently learned that you can also type . script.sh Is there any difference? The second is much easier for me since my keyboard ...
-1
votes
1answer
18 views

sql query fro oracle DB using shell script [closed]

$ cat DBUpdate #!/bin/bash sqlplus -s bb_split/pwd@q:1521 <<< "DELETE OUT_QUEUE01 WHERE TDATE=TO_DATE('$1', 'YYYYMMDD')" i get below error: ./DBUpdate: line 5: sqlplus: command not found ...
0
votes
0answers
20 views

identify a process with command and kill it [duplicate]

I want to kill a process which has /app/test/bin in the command name using shell script In below example:I want to kill the last one. nyxqa 25939 0.0 0.0 121416 2792 ? S Aug10 0:00 ...
-1
votes
0answers
35 views

bash: ${debian_chroot!-}: bad substitution

So I'm learning how to shell script and i got this error. Every thing I've read on the other posts makes it seem like a directory file path like most terminal commands have stashed away. My version of ...
3
votes
2answers
185 views

Script to set IP address connected to an interface to a shell variable

I want to write a script to set the IP address of the device connected to an interface like "eth0" to a variable. I can get the IP address by this command: arp -i eth0 -a The output of above ...
0
votes
1answer
46 views

Lengthen Variables

I print data to a form in a console and use tput cup the print it on the same position. This way I can create a sort of form with a small discription of each value. but if you run var=12 tput cup 2 ...
0
votes
0answers
11 views

ERROR with gem for a ruby tool?

I am trying to install a tool script called bio-polyploid-tools and I am getting this error after command sudo gem install bio-polyploid-tools sammanmahmoud@samman[bioruby-polyploid-tools-master] ...
0
votes
1answer
72 views

Removing everything from my Ubuntu install, even GUI..?

I've got an interesting question today. I want to remove EVERYTHING from my Ubuntu install (or remove the OS and just add an empty kernel), but in either case I don't know exactly how. I want a ...
0
votes
1answer
42 views

not getting output in terminal while running the php script

test3cron.php <?php @ob_start(); session_start(); $callbackUrl = "http://mgstore/test3cron.php"; $temporaryCredentialsRequestUrl = "http://mgstore/oauth/initiate?oauth_callback=" . ...
1
vote
1answer
56 views

bash - can shellcode be made from a bash script?

I was thinking it can't, since there's not really a binary for bash scripts, but having to write a C program every time you need to generate shell code for a single command is just a pain.
0
votes
1answer
27 views

source a config value with variables [closed]

Example: I have a config file where I want below to have date in the value cat conf.ini path=/var/opt/[date]/yellow I want my script foo to read path and substitute with date passed as argument ...
2
votes
3answers
78 views

shell sript to read source file and use the key in the script

#!/bin/bash source /data/output/QAScripts/conf.ini var=$($1path) echo $var conf.ini is the config file which has LSTpath=/data/bb/loader I get below below error. Where am I going wrong. ./file ...
4
votes
3answers
2k views

Syntax error near unexpected token `('

When I use below code in Ubuntu terminal, it works fine: rm !(*.sh) -rf But if I place the same line code in a shell script (clean.sh) and run the shell script from terminal, it throws an error: ...
0
votes
2answers
46 views

Concatenate multiple files without header

I have several directories ("amazon", "niger",...), in which I have several subdirectories ("gfdl", "hadgem",...), in which I also have several sub-directories ("rcp8p5", "rcp4p5",...). In this last ...
0
votes
2answers
37 views

Cannot open zip created with shell script [duplicate]

I try to make a backup script, but when i create a zip with the script, and use cd myzip it sais that it dosnt exitst even when i can see it on the server with FileZilla. This is my script: ...
0
votes
2answers
49 views

End of file syntax error shell scripting [closed]

#!/bin/bash source conf.ini inotifywait -m -e create /$1path | while read file; do if ($(echo $word | head -c 1)"=$1 then echo $file cd $1inputpath ls -l |grep $file* zcat $file* > ...
0
votes
0answers
17 views

scan folders for file parallely with shell script [duplicate]

I have multiple folders which i have to scan them real time asynchronously with shell script.Can some one help me. Its like I have folder1/fodler2/folder3 ....,i need to scan these folder for files ...
1
vote
2answers
34 views

How do i run different scripts parallely using shell

I have script1,script2,script3 I have to execute all the three at same time using one shell script.Not one after the other.How do I do that?
12
votes
2answers
691 views

Is there an easy way to log all activity that a shell script does?

Is there an easy way to log all activity that occurs from a shell script to a file? I have a script. It outputs things like echo "instructions", as well as other program output. I know the commands: ...
2
votes
2answers
26 views

I have to use a command in shell script which will give a prompt for Y or N.How do i answer it as Y in shell script afater the command

$ command Are you sure you want to set cOrders to be Y? <Y/N> Y How to i do the answering as Y in shell script
2
votes
4answers
102 views

how can I List files in order

I had an 18GB file I needed to download on a less than great Internet connection. Torrenting wasn't an option. So I busted up the file into 100 segments, and eventually, all of it downloaded. Now I ...
1
vote
2answers
54 views

How do I find and replace in file1 with values from file2

file1 O,tested test,12345 OC,test explore,34567 file2 O,new order OC,new quote I need an output like below: New order,tested test,12345 New quote,test explore,34567
2
votes
4answers
170 views

Using sed, how could we cut a specific string from a line of text?

Using sed, how could we cut a specific string from a line of text? The string -> Email subject: Test email one two Expected response -> test email one two Any help in this regard would be ...
1
vote
2answers
69 views

In Bash or ZSH, is there an opposite to the `clear` command?

Typing clear into a shell creates a bunch of new lines until the output history above is all but hidden. Is there a command or method that does the opposite of clear? That essentially moves your ...
1
vote
2answers
48 views

How can I get a list with the packages selected by apt-get autoremove?

Is there any command that prints only the name of the packages that apt-get autoremove selects? I'm creating a script that updates the kernel, removes the old kernel and the unnecessary packages ...
0
votes
2answers
49 views

How to insert data from text to mysql? [closed]

I get this text from router via ssh. But I want to insert user(fr-XXX) and macadress(F0:24:75:33:22:11) to mysql routerusers table. Flags: M - mac-cookie # USER DOMAIN ...
0
votes
2answers
180 views

Can't run shellscript with sudo

When I try to run my script like this: sudo ./connector.sh It give me this: sudo: ./connector.sh: command not found What am I doing wrong?
8
votes
5answers
546 views

How do you output the filename in find command while using -exec?

I use the following line to find all sub-directories of the PWD and run svnadmin verify on each directory (I already know that they're Subversion repositories) find ./* -maxdepth 0 -exec svnadmin ...
2
votes
1answer
42 views

parse webpage upto n levels using wget

I am trying to extract URLS from a webpage up to user defined n levels using wget. I tried this wget -r -l$2 --reject=gif -O out.html www.google.com | sed -n 's/.*href="\([^"]*\).*/\1/p'` " It is ...
1
vote
1answer
70 views

how to handle file names with spaces

I am developing a GUI search program. I need help to handle filenames with spaces. I just can't figure it out. Here is my code: #!/bin/bash USERNAME=$(whoami) INPUT=$(zenity --entry) updatedb ...