Questions tagged [unix-shell]
130 questions
0
votes
1 answer
remote script execution from local script linux doesn't stop for remote script prompts
script abc.sh is on machine M1 and xyz.sh is on machine M2
script abc.sh:
#!/bin/bash
ssh -l user1 host.com ./xyz.sh -b1 arg1 -b2 arg2
script xyz has certain user prompts like pwd etc
When I execute script bc.sh from machine M1, it keeps looping…

S.Singh
- 1
0
votes
2 answers
How to compare timestamp of same file residing in two diff directories
I have a requirement like following:
I have two dir: DIR1 and DIR2. Files of DIR1 are updated on a regular basis based on requirement. Then updated files are copied to DIR2. So I need to write a shell script which will tell us whether all the files…

Prasenjit Patra
- 61
- 2
- 3
- 4
0
votes
1 answer
How to run a program inside chroot with stdin/stdout available to caller?
Is there a way to run a program in a chroot while still having access to stdin/stdout?
My first attempt was a shell script:
/usr/local/bin/real-app:
--------
#!/bin/bash
chroot /var/lib/app-root /usr/bin/app $*
Then symlinked it where things…

Mark Renouf
- 1,373
- 2
- 16
- 22
0
votes
2 answers
Moving files between hosts using intermediate storage area
Is there any good existing solution for moving files from host A to host C, using host B a an passive intermediate storage area.
A -> B -> C
Limitations
Host A and host C are on separate networks and can not access each
other. No tunnels can be…

error
- 117
- 1
0
votes
2 answers
Can I trust that every Debian-derived distro will have a 'base-files' package that contains '/etc/debian_version'?
What I want is a quick, reliable command to ascertain that the Linux I'm running in is Debian-based. The following command seems to work. It also returns the Debian version:
dpkg -L base-files 2>/dev/null | grep '^/etc/debian_version$' >/dev/null…

JCCyC
- 680
- 3
- 13
- 24
0
votes
1 answer
Executing command remotely on another linux server from a shell script
I have a shell-script which extract details from a log file between two dates and executes a command on the output to generate some report.The log files are on different server and scripts are executed on different server. the Script looks like : …

anand
- 152
- 6
0
votes
5 answers
removing duplicate lines from file with grep
I want to remove all lines where the second column is 05408736032.
0009300|05408736032|89|01|001|0|0|0|1|NNNNNNYNNNNNNNNN|asdf|
0009367|05408736032|89|01|001|0|0|0|1|NNNNNNYNNNNNNNNN|adff|

user5967
- 135
- 2
- 6
0
votes
1 answer
unable to run the script in linux using plink
I'm unable to run a script in linux using plink.exe. I'm using my user x to login and script is under y user, which I need to sudo to y and run it. I was able to at command prompt manually but not through script (for automation).
plink.exe -v -t -l…

sagar
- 1
- 1
0
votes
1 answer
Fix Solaris 11 GNU tools location for RVM
I am trying to install RVM on a Solaris 11 system, the curl -sSL https://get.rvm.io | bash -s stable went through, but when I actually try to use rvm, it simply stats "ERROR: Missing GNU tools: grep which awk cp date find sed tail tar xargs. Make…

Metaphox
- 101
- 2
0
votes
2 answers
redirect command executed along with output shell
I would like to redirect the command executed along with the output to a file.
for example:
#ls >ls_out.txt
ls_out.txt should be something like :
ls
file1 fil2
Thanks!

kumar
- 433
- 3
- 10
- 23
0
votes
1 answer
Check processor status- check processor/cpu status and failed/off status
I want to Check processor status- check processor/cpu status and failed/off status so for that I used command prtdiag and want to fetch the cpu status only from that. how can i do that?

user2189689
- 1
- 1
0
votes
1 answer
I want to save events or logs grabbed using Inotify to a file
I need your help - using Inotify I am watching a directory for the changes like create, delete, rename and move. I want these event to be logged in a file and I want to run Inotify as a service.
0
votes
2 answers
How to secure svn+ssh checkout users?
All our SVN repositories are hosted on a dedicated machine on which all the developers have access. Every now and then we need to checkout a repository on a machine we don't own or operate ourselves. Currently we all use our own system (SSH) account…
user99559
0
votes
4 answers
Chars referenced by octal values in *NIX shell scripts -- getting them to be parsed?
I have a script which absolutely 100% _has_ to be done in this ridiculous fashion:
echo $'\150\151\073\145\143\150\157' $'\171\141\171'
(unencoded: echo hi;echo yay)
The problem is that everything after the echo is assumed to be an argument, so the…

Jim
- 1
0
votes
1 answer
Shell command to find and file the last modified file in a certain directory
I want to create an alias that displays the latest log in a certain directory - something like:
ls -lat *log* | tail -1 | less
The above command does not work as the output of the ls -lat command does not produce a single final name but a full list…

RonK
- 241
- 1
- 5
- 13