Search Results

Search: Posts Made By: DC Slick
2,872
Posted By DC Slick
I'm not sure but I think it's because your var...
I'm not sure but I think it's because your var CMD is set to a string
"/usr/bin/sudo /bin/su - villin" <---- this is a string not a command

try this:
CMD=`/usr/bin/sudo /bin/su -villin`
...
9,144
Posted By DC Slick
cURL auto resume
Searched here and google and couldn't find a viable solution. Is there a way to transfer a file with curl and have it automatically attempt to resume it if there's an error, broken pipe,...
2,161
Posted By DC Slick
not proper syntax... the . needs a / after it....
not proper syntax... the . needs a / after it. Files starting with a . are hidden files. So .B is a legit file name. Filenames can have spaces in them too. So: [SPACE]B is a legit name too, just not...
2,161
Posted By DC Slick
the dot (period) means "in the current working...
the dot (period) means "in the current working directory". So ./B means "execute B which is in the current working directory". You can use it with other commands too such as find. find . -type f...
7,737
Posted By DC Slick
There's a reason you're listed in the credits of...
There's a reason you're listed in the credits of my script lol
2,369
Posted By DC Slick
yea you gotta keep to the if/then or...
yea you gotta keep to the if/then or if/then/else...syntax. You need to specify what to do in the event the test (if) is true or false. Human speak: If something evaluates to true or false then do...
7,737
Posted By DC Slick
Untar specific directory and strip leading directories
Ok so I know the title was probably confusing so here goes: I have a tarball (gzipped) that has a nested directory structure . For example:

my.tar.gz (contents)
[.]
...
5,219
Posted By DC Slick
The script indeed has terminal output and exit...
The script indeed has terminal output and exit codes for success and non successful termination. When complete it doesnt return the prompt but if i type ls it will ls as if i were at a prompt. I want...
9,544
Posted By DC Slick
why not use sed? sed...
why not use sed? sed 's/Parent=PAC:18235173;PACid=18235173/Parent=PT_0001s00200.1;PACid=18235173/g'

You can do an inline edit to the same file using the -i switch. Or redirect it to another file...
5,219
Posted By DC Slick
Ok found the caveat: If any of my conditions have...
Ok found the caveat: If any of my conditions have an exit 0, the terminal prompt doesn't come back. I can still type commands successfully but i have to manually issue a ^C interrupt to the terminal...
17,273
Posted By DC Slick
I don't want to use echo because I want the first...
I don't want to use echo because I want the first line to be a comment, and the rest to be values that a script reads from. If the user deletes the commented line like they're not supposed to, i want...
17,273
Posted By DC Slick
What are my alternatives? Examples?
What are my alternatives? Examples?
17,273
Posted By DC Slick
Sed insert text at first line of empty file
I can't seem to get sed to allow me to insert text in the first line of an empty file. I have a file.txt that is a 0 byte file. I want sed to insert " fooBar" onto the first line. I've tried a few...
5,219
Posted By DC Slick
Perfect. There's no thank you button on your post...
Perfect. There's no thank you button on your post for some reason but thank you. That was the trick
3,531
Posted By DC Slick
Honestly I don't know, I thought that would work....
Honestly I don't know, I thought that would work. I'm at the end of my knowledge level on that...Sorry.
5,219
Posted By DC Slick
SIGSTOP and SIGKILL
Which is sent to a terminal when it closes? SIGKILL? Reason I ask is I have a script I want to run in the background, but want it to run even if the terminal window is closed. Or, I'd like it to...
1,429
Posted By DC Slick
definitely using a getopts loop. I think piping...
definitely using a getopts loop. I think piping this to a shell is the way to go for me. Thanks you guys
4,596
Posted By DC Slick
.Do you want to replace ALL commas in your script...
.Do you want to replace ALL commas in your script to something else? sed -i "s/\,/\|/g" infileChanges all commas to the pipe

Before using sed -i, do it without the -i so you can see what it'll do...
1,429
Posted By DC Slick
Execute sed altered script
Man...no one answered my last two posts...Oh well, so hey guys i have a script that i'm wanting to put a # on a certain line, and then execute the script but not write it to the script. So far I'm...
17,015
Posted By DC Slick
sed -i 's/""/"/g' /path/to/file ----------...
sed -i 's/""/"/g' /path/to/file

---------- Post updated at 02:40 AM ---------- Previous update was at 02:39 AM ----------

lol damn...too slow
3,531
Posted By DC Slick
ah ok. I guess I learned something. :-) So did...
ah ok. I guess I learned something. :-) So did that work for you?
3,531
Posted By DC Slick
That's what that will do. It will only allow...
That's what that will do. It will only allow someone who is logged in with a name you've authorized to run the script, to execute the script. If the person logged in is anyone else, it will exit. So,...
3,531
Posted By DC Slick
You have to use backticks ` to surround the who...
You have to use backticks ` to surround the who -m command. Backticks are right next to the number 1 on my laptop's keyboard. Should be for your computer too. Looks like a ' but its not. So:
[ `who...
3,531
Posted By DC Slick
[ ! `whoami` = "user1" -o "user2" -o "user" ] &&...
[ ! `whoami` = "user1" -o "user2" -o "user" ] && echo "You are not authorized to run this script"
This says if you're NOT user1 or user2 or user to echo "You are not authorized to run this script"...
3,531
Posted By DC Slick
Yea see I personally wouldn't want to be "logging...
Yea see I personally wouldn't want to be "logging in" to your script with my username and password. Leaves a lot to be desired as far as security. If you allow the user to login to the shell, and...
Showing results 1 to 25 of 80

 
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy