10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have this code
#!/bin/bash
LZ () {
RETVAL="\n$(date +%Y-%m-%d_%H-%M-%S) --- "
return RETVAL
}
echo -e $LZ"Test"
sleep 3
echo -e $LZ"Test"
which I want to use to make logentrys on my NAS. I expect of this code that there would be output like
2017-03-07_11-00-00 --- Test (4 Replies)
Discussion started by: matrois
4 Replies
2. Shell Programming and Scripting
Hi
i was going through the script debugging technique. below example was given in the book.
1 #!/bin/sh
2
3 Failed() {
4 if ; then
5 echo "Failed. Exiting." ; exit 1 ;
6 fi
7 echo "Done."
8 }
9
10 echo "Deleting old backups,... (11 Replies)
Discussion started by: scriptor
11 Replies
3. Shell Programming and Scripting
Hi all,
I'm not clear of this regexp command:
regexp {(\S+)\/+$} $String match GetString
From my observation and testing,
if $String is abc/def/gh
$GetString will be abc/def
I don't understand how the /gh in $String got eliminated.
Please help. Thanks (2 Replies)
Discussion started by: mar85
2 Replies
4. Shell Programming and Scripting
i am beginner in shell scripting.
not able to understand what below line will do.
PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST
below is the script
#!/bin/hash
PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST ;
echo $PS1
and i getting the below output
Žuname -nŽ$ (25 Replies)
Discussion started by: scriptor
25 Replies
5. UNIX for Dummies Questions & Answers
If I don't explain my issue well enough, I apologize ahead of time, extreme newbie here to scripting.
I'm currently learning scripting from books and have moved on to the text Wicked Cool Shell Scripts by Dave Taylor, but there are still basic concepts that I'm having trouble understanding.
... (10 Replies)
Discussion started by: Chasman78
10 Replies
6. Shell Programming and Scripting
Hi
I have wrote the small script, where $SRC=$HOME
the input file is simple text file having directories in my $SRC on pre line
desktop
download
myfiles
games
#!/bin/bash
FILENAME=$1
ERROR_LOG="$SRC/err.$$.log"
while read line
do
echo "########## strat Gmake $line... (6 Replies)
Discussion started by: the.reverser
6 Replies
7. Shell Programming and Scripting
Hi Guys,
I am absolutely a newbie to Solaris 8.0. Following is a piece of code in a script (/bin/sh). Can anybody help me in deciphering this ? Please see my questions after the script code -
_____________________________________________________
/bin/rm -f mycron
crontab -l | grep -v... (5 Replies)
Discussion started by: angshuman_ag
5 Replies
8. Shell Programming and Scripting
#! /usr/bin/ksh
old=$1
new=$2
for file in *.$old ; do
mv $file ${file%$old}$new
done
exit 0
This script i got from the forum. script changes the extension of the files say example
a.txt to a.doc
b.txt to b.doc
c.txt to c.doc
d.txt to d.doc
this scipt works fine but i am not... (2 Replies)
Discussion started by: vijays3
2 Replies
9. Shell Programming and Scripting
Hi,
Can anyone please let me know the meaning of this line,i am not able to understand the egrep part(egrep '^{1,2}).This will search for this combination in beginning but what does the values in {}signifies here.
/bin/echo $WhenToRun | egrep '^{1,2}:$' >/dev/null (1 Reply)
Discussion started by: namishtiwari
1 Replies
10. Filesystems, Disks and Memory
can anyone give me some idea on unix filesystem namei's algorithsm (2 Replies)
Discussion started by: kangc
2 Replies