Results 1 to 5 of 5
"Write a script to see if Lets_Count is a file. The display should state that it is or is not a file."
I need help with this one, I am ...
- 02-09-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 5
help with a conditional script
"Write a script to see if Lets_Count is a file. The display should state that it is or is not a file."
I need help with this one, I am so lost its not funny X_X
- 02-09-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
Explain better and start with a few ideas, we'll help you throughout, if it's not homework (see forum rules)
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 02-09-2010 #3
Looks like homework to me and that's against the rules
Linux User #453176
- 02-09-2010 #4Just Joined!
- Join Date
- Feb 2010
- Posts
- 5
?_?
#!/bin/sh
# meow
stat -c%F /home/barkeep/Lets_Count
if [ "$stat -c%F /home/barkeep/Lets_Count" = "regular file" ]; then echo "is a file"
else echo "is not a file"
fi
the outcome of the script.
root@barkeep-desktop:/home/barkeep# . script6
regular file
is not a file
and no ... this isn't home work.
- 02-09-2010 #5Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
is smarterCode:test -f
And why do you source your script ?
Make it executable and run itCode:. script6
Code:chmod +x script6 script6
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.


