10 More Discussions You Might Find Interesting
1. Programming
hi all,
i have made a shell script and it runs until it reaches the if statement, doesn't the ! mean only if the command fails it will echo me that message and then exit
can anyone please help me what is wrong with my code?
many thanks,
rob
#!/bin/bash
echo "is this archive... (10 Replies)
Discussion started by: robertkwild
10 Replies
2. HP-UX
Hello
I have a shell script that is run as root. Script rins ok until the point where it have to switch to user "mqm" to run other commands. It just hangs at the point of this line in the script
su - mqm -c "dspmq"
I ran the same commands at the terminal and they run fine.
Any thoughts. (6 Replies)
Discussion started by: mo12
6 Replies
3. Shell Programming and Scripting
Hi Sir/Madam
I have a file data.txt like below
file_name date_of_creation
x 2/10/2012
y 8/11/2010
z 11/3/2013
a 2/10/2013
b 3/10/2013
c ... (4 Replies)
Discussion started by: kumar85shiv
4 Replies
4. UNIX for Dummies Questions & Answers
I have simple script. like that, I am working on /usr/local/src and also under src folder there is a ft folder
#!/bin/ksh
#!/bin/bash
dirpath="/usr/local/src/ft"
echo $dirpath
cd $dirpath
echo displays ok "/usr/local/src/ft"
but that doesn't enter "ft" folder. stays in current... (4 Replies)
Discussion started by: F@NTOM
4 Replies
5. Shell Programming and Scripting
Hi folks
I'm coding on Ubuntu 9.04 standard shell.
I'm writing a script that needs to generate a random number at some point of its execution.
When I do
echo $RANDOMas a command inside shell, I clearly get some randomly generated number
However when I do
i=`$RANDOM`
echo $ior even... (14 Replies)
Discussion started by: ksk
14 Replies
6. Shell Programming and Scripting
Hello
I have a Zabbix Server were Linux kernel version 2.6.26-2-amd64 is running.
now my Question how can i make a script that does:
- connect with ssh to a device
- get the systeminfo (but only the interfaces, mac adresses, serialnumber and Software version)
- write the output in a file
... (18 Replies)
Discussion started by: Fraggy
18 Replies
7. Shell Programming and Scripting
I need to do a work to my job, but i m new in script shell, someone can help with this.. :confused:
Description
Bsafe The command creates a backup directory of each month at the command line (arguments of the script). The names of directories to copy will always be specified for the... (4 Replies)
Discussion started by: strshel
4 Replies
8. Shell Programming and Scripting
Dear All,
I am trying to run a script in background like ./scriptname.sh & but when i try to run it in background it is giving me an error "syntax error at line 12: `(' unexpected" at the line 12, there is a function definition
"function getFileList()".
This script runs fine if i run on... (2 Replies)
Discussion started by: bilalghazi
2 Replies
9. Shell Programming and Scripting
#!/bin/sh
something(){
echo "Inside something"
echo $1 $2
}
val=$(something "Hello " "world")
Output expected:
Inside somethingHello world
But it's not echoing. (4 Replies)
Discussion started by: cola
4 Replies
10. Shell Programming and Scripting
Hi
Linux
Set up - alias ls='ls -l'
Then run script
#! /bin/ksh
sub()
{
ls
}
sub
Is there any way to get it working. I don't want to define alias inside of the program
Thank you (2 Replies)
Discussion started by: zam
2 Replies