10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I wish to replace "\\n" with a single white space.
The below does the job on command-line:
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 Replies
2. Shell Programming and Scripting
local script:
cat > first.sh
cd /tmp
echo $PWD
echo `whoami`
cd /tmp/123
tar -cvf 789.tar 456
sleep 10
except script:
cat > first
#!/usr/bin/expect
set ip 10.5.15.20
set user "xyz123"
set password "123456"
set script first.sh
spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies
3. Shell Programming and Scripting
( sleep 3
echo ${LOGIN}
sleep 2
echo ${PSWD}
sleep 2
while read line
do
echo "$line"
PID=$?
sleep 2
kill -9 $PID
done < temp
sleep 5
echo "exit" ) | telnet ${HOST}
while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies
4. Shell Programming and Scripting
Hi all,
I have a script that can be run via cron or via the command line.
Is there any way that I can place something on the script to be able to distinguish/differentiate whether the script was run via a user in the command line or whether it was run from the cron? (3 Replies)
Discussion started by: newbie_01
3 Replies
5. Shell Programming and Scripting
So I have a script that runs as a non-root user, lets say the username is 'xymon' .
This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root.
in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies
6. Shell Programming and Scripting
Hello everyone,
I have a perl script which takes various command line options from user like :
test.pl -i <input_file> -o <output_file> -d <value> -c <value>
Now I have multiple input files in a directory:
<input_file_1>
<input_file_2>
<input_file_3>
<input_file_4>
.....
....
...... (6 Replies)
Discussion started by: ad23
6 Replies
7. Shell Programming and Scripting
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies
8. Shell Programming and Scripting
Hi,
i need to run a command as root.Whoever executes the command ,i will check for a particular role if that is satisfied i have to make it to run as root.
Please help me to carry out this.
Thanks
Padmini (1 Reply)
Discussion started by: padmisri
1 Replies
9. HP-UX
Hi all,
Can somebody give me advice on how to run tlremove and tlinstall command without root login.
When i try to login to root i get error message as "crt0: ERROR couldn't open dld.sl errno:000000002". This error comes when transition link is removed.
so i want to reinstall the link...
... (1 Reply)
Discussion started by: aditya.gaur
1 Replies
10. UNIX for Dummies Questions & Answers
All,
I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies